package com.feng.controller;

import com.feng.dto.LoginUser;
import com.feng.dto.Result;
import com.feng.pojo.Good;
import com.feng.service.CarService;
import com.feng.service.GoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/car")
public class CarController {

    @Autowired
    CarService carService;

    @GetMapping("/getSortGood")
    public Result getSortGood(LoginUser loginUser) {
        return carService.getSortGood(loginUser.getId());
    }

    @GetMapping("/putInCar")
    public Result putInCar(@RequestParam("googId") Integer goodId,@RequestParam("repertory") Integer repertory,@RequestParam("number") Integer number, LoginUser loginUser) {
        return carService.putInCar(goodId, repertory, number, loginUser.getId());
    }
}
